<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <link rel="stylesheet" type="text/css" href="../lib/resources/css/ext-all.css"/>
        <script type="text/javascript" src="../lib/js/ext-base-debug.js">
        </script>
        <script type="text/javascript" src="../lib/js/ext-all-debug.js">
        </script>
        <script type="text/javascript" src="../lib/js/ext-lang-zh_CN.js">
        </script>
        <script type="text/javascript" src="../lib/js/FieldLabeler.js">
        </script>
        <script type="text/javascript" src="../lib/js/FormTableLayout.js">
        </script>
        <style type="text/css">
            body {
                padding: 20px;
                font-size: 10px;
                line-height: 12px;
            }
            
            #myForm {
                height: 400px;
                width: 880px;
            }
            
            .hightlight {
                background-color: #000055;
            }
        </style>
        <script type="text/javascript">
            
            Ext.form.TextField.override({
                initComponent: Ext.form.TextField.prototype.initComponent.createInterceptor(function(){
                    if (this.allowBlank === false && this.fieldLabel) {
                        this.fieldLabel += '<font color=red>*</font>';
                    }
                })
            });
            alert(123);
            
            Ext.onReady(function(){
                new Ext.form.FormPanel({
                    title: '表单',
                    bodyStyle: 'padding:10px',
                    renderTo: 'myForm',
                    layout: 'tableform',
                    labelWidth: 80,
                    labelSeparator: ':',
                    labelAlign: 'right',
                    defaults: {
                        xtype: 'textfield',
                        width: 126,
                        height: 20
                    },
                    layoutConfig: {
                        columns: 4
                    },
                    items: [{
                        allowBlank: false,
                        fieldLabel: '客户编码',
                        xtype: 'combo',
                        store: [1, 2, 3, 4],
                        name: 'customer_code'
                    }, {
                        allowBlank: false,
                        fieldLabel: '客户简称',
                        name: 'customer_short'
                    }, {
                    
                        fieldLabel: '客户全名',
                        name: 'customer_name'
                    }, {
                        fieldLabel: '客户类型',
                        xtype: 'combo',
                        name: 'customer_type'
                    }, {
                        fieldLabel: '负责人',
                        name: 'charge_person'
                    }, {
                        fieldLabel: '联络人',
                        name: 'contact_person'
                    }, {
                        fieldLabel: '联系电话1',
                        name: 'contact_phone1'
                    }, {
                        fieldLabel: '联系电话2',
                        name: 'contact_phone2'
                    }, {
                        fieldLabel: '传真',
                        name: 'fax'
                    }, {
                        fieldLabel: '电子邮箱',
                        name: 'email'
                    }, {
                        fieldLabel: '资本额(万)',
                        allowNegative: false,
                        allowDecimals: false,
                        xtype: 'numberfield',
                        allowBlack: false,
                        name: 'capital'
                    }, {
                        fieldLabel: '年营业额(千)',
                        xtype: 'numberfield',
                        name: 'turnover'
                    }, {
                        fieldLabel: '员工数量',
                        xtype: 'combo',
                        name: 'staff_amount'
                    }, {
                        fieldLabel: '业务人员',
                        xtype: 'combo',
                        name: 'profession_person'
                    }, {
                        fieldLabel: '地区',
                        xtype: 'combo',
                        name: 'area'
                    }, {
                        fieldLabel: '国家',
                        xtype: 'combo',
                        name: 'country'
                    }, {
                        fieldLabel: '开业日期',
                        name: 'start_date'
                    }, {
                        fieldLabel: '核准情况',
                        xtype: 'combo',
                        name: 'check_state'
                    }, {
                        fieldLabel: '交易币种',
                        xtype: 'combo',
                        name: 'money_type',
                        colspan: 2
                    }, {
                        fieldLabel: '登记地址1',
                        name: 'regist_address1',
                        width: 341,
                        colspan: 2
                    }, {
                        fieldLabel: '登记地址2',
                        name: 'regist_address2',
                        width: 340,
                        colspan: 2
                    }, {
                        fieldLabel: '备注',
                        name: 'remark',
                        xtype: 'textarea',
                        width: 770,
                        colspan: 4,
                        height: 60
                    }]
                });
                
                new Ext.form.FormPanel({
                    renderTo: 'form1',
                    height: 400,
                    width: 400,
                    title: '表单',
                    defaults: {
                        anchor: '95%',
                    },
                    items: [{
                        xtype: 'textfield',
                        fieldLabel: '姓名',
                        name: 'name',
                        allowBlank: false
                    }]
                });
            });
        </script>
    </head>
    <body>
        <div id="myForm">
        </div>
        <div id="form1">
        </div>
    </body>
</html>
